<?php
/**
 * DbException.php
 * @author zohnの梦
 * @email  1171672036@qq.com
 * @date   2021/1/8
 */

namespace app\common\exception;


class DbException extends \Exception
{
    protected $code = -1;
    protected $message = '';
    protected $previous = null;

    public function __construct($code = -1, $message = '', \Throwable $previous = null)
    {
//        parent::__construct($message, $code, $previous = null);
        $this->code     = $code;
        $this->message  = $message;
        $this->previous = $previous;
    }

    public function getErrorCode()
    {
        return $this->code;
    }

    public function getErrorMessage()
    {
        return $this->message;
    }

    public function getErrorPrevious()
    {
        return $this->previous;
    }
}